/*
 * Douglas Hiura Longo, 14 de Setembro de 2010.
 * 
 * twitter.com/douglashiura
 * java.inf.ufsc.br/dh
 * douglashiura.blogspot.com
 * douglashiura.parprimo.com
 * douglashiura@gmail.com
 * */
package net.douglashiura.picon;

import java.lang.reflect.InvocationTargetException;
import java.util.Deque;

public class PiconAtributoEntidade<T> extends Picon<T, T> {
	private T umObjeto;

	public PiconAtributoEntidade(Class<T> classe,
			Deque<Toke> emColchetesComecoClasse, PiconStore contexto)
			throws InstantiationException, IllegalAccessException,
			NoSuchFieldException, NoSuchMethodException,
			InvocationTargetException, ClassNotFoundException {
		this(classe, new ResolverReflexao<T>(classe), emColchetesComecoClasse,
				contexto);
	}

	public PiconAtributoEntidade(Class<T> classe, ResolverReflexao<T> reflexao,
			Deque<Toke> emColchetesComecoClasse, PiconStore contexto)
			throws InstantiationException, IllegalAccessException,
			NoSuchFieldException, NoSuchMethodException,
			InvocationTargetException, ClassNotFoundException {
		super(contexto);
		umObjeto = classe.newInstance();
		processaAtributo(emColchetesComecoClasse, reflexao, umObjeto);
	}

	public T getObjeto() {
		return umObjeto;
	}
}
